﻿using System;
using System.Text;
using DependencyAnalysis;
using DependencyAnalysis.Internal;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTests
{
    [TestClass]
    public class IlReaderTest
    {
        [TestMethod]
        public void TestMethod1()
        {
            var ilReader = new CilParser();
            var methodInfos = typeof(Analyzer).GetMethods();
            StringBuilder text = new StringBuilder();
            foreach (var method in methodInfos)
            {
                var instructions = ilReader.ReadInstructions(method);
                foreach (var instruction in instructions)
                {
                    text.AppendLine(string.Format("{0}:\t{1}\t\t{2}", instruction.Offset, instruction.OpCode, instruction.OperandNonSerialized));
                }
            }
        }
    }
}
